﻿using System;
namespace SumSequence
{
    class SumSequence
    {
        static int StringSequenceToSum(string sequence)
        {
            int sum = 0;
            string[] numbers = sequence.Split(' ');
            for (int index = 0, length = numbers.Length; index < length; index++)
            {
                int number;
                if (int.TryParse(numbers[index], out number))
                {
                    sum += number;
                }
            }
            return sum;
        }
        static void Main()
        {
            Console.WriteLine("Enter the sequence with spacing between the numbers: ");
            string input = Console.ReadLine();
            Console.WriteLine("The sum is: {0}", StringSequenceToSum(input));
        }
    }
}
